The present invention relates to methods of managing digital fonts.
In the context of digital typography, the term xe2x80x9ccharacterxe2x80x9d refers to the general concept of a letter, number, symbol, ideograph or the like, without reference to a particular font, whereas the term xe2x80x9cglyphxe2x80x9d refers to a specific instance of a character in a font. In this specification, the terms will be used in this sense, although they are sometimes used interchangeably. A font is a collection of glyphs with a single aesthetic design, e.g., regular Times New Roman. A collection of fonts with visually related styles, e.g., regular, bold, italic and bold italic versions of Time New Roman, can be referred to as a xe2x80x9ctypefacexe2x80x9d or a xe2x80x9cfont familyxe2x80x9d, although sometimes this collection of related styles is considered to be a single xe2x80x9cfontxe2x80x9d.
Digital typefaces and fonts, such as the PostScript(copyright) font products available from Adobe Systems Incorporated of San Jose, Calif., generally include instructions for rendering glyphs on an output device, such as a printer or monitor. A conventional digital font, such as the PostScript Type 1 font format, can include only a limited number of glyphs. For example, a Type 1 font usually includes no more than 256 glyphs. Since some font families include more than 256 glyphs, the related styles must be packaged as separate digital fonts. For example, the Adobe Garamond Type 1 font is packaged as a Regular font, a Small Caps and Old Style Figures font, and an Expert font. This makes it difficult for a user to compose text that mixes the various styles.
More recent font formats, such as the OpenType font format, can include a large number of glyphs. In addition, OpenType fonts include a glyph substitution mechanism that permits a font designer to specify both a feature and a set of glyph substitutions to perform if the feature is activated. For example, an OpenType font can include multiple glyphs for the same character, e.g., non-italic and italic versions, and a feature that specifies whether the italic version of the character should be used instead of the non-italic version.
Although OpenType fonts can include multiple versions of the same character, some OpenType fonts will continue to be constructed in a conventional fashion, with different styles packaged in separate digital fonts. In addition, if existing digital fonts in the PostScript Type 1 font format are converted to the OpenType font format, e.g., with an Adobe OpenType Converter program, these converted fonts will also be separated into multiple font packages per font family. Consequently, users will still experience difficulties when composing text that mixes various styles from these separately packaged digital fonts.
In one aspect, the invention is directed to a computer-implemented method of combining fonts. In the method, one of two fonts is identified as a first font and the other of the two fonts is identified as a second font. The first font contains a first plurality of glyphs, and the second font contains a second plurality of glyphs. Each glyph including rendering instructions. The first plurality of glyphs from the first font and the second plurality of glyphs from the second font are copied into a combined font, each glyph in the combined font being assigned a unique identification code. A mapping of a first plurality of code points in an encoding scheme to the identification codes of the first plurality of glyphs in the combined font is generated, and a substitution feature is generated in the combined font that can substitute at least one of the first plurality of glyphs in the combined font with at least one of the second plurality of glyphs in the combined font.
Implementations of the invention can include the following features. The substitution feature can include a mapping of the identification codes of the first plurality of glyphs in the combined font to the identification codes of the second plurality of glyphs in the combined font. A name of the second font can be assigned to the feature substitution, e.g., from user input, from a font name stored in the second font, or by removing a common prefix from the names of the first and second fonts. One of the two fonts can be identified as the first font from user input, from the font names of the two fonts, or by which font contains a glyph that represents a preselected code point. A third plurality of glyphs can be copied from the second font to the combined font, and the mapping can include mappings between the third plurality of glyphs in the combined font and a second plurality of code points in the encoding scheme. A fourth plurality of glyphs can be copied from the first font to the combined font, and the substitution feature in the combined font can substitute at least one of the fourth plurality of glyphs with at least one of the third plurality of glyphs. Copying the first and second pluralities of glyphs into a combined font can includes renumbering identification codes to prevent overlapping identification codes in the combined font. The first and second fonts include glyphs from the same font family, glyphs from the different font families, or glyphs that represent characters from different languages.
Advantages that can be seen in specific implementations of the invention include one or more of the following. Separately packaged digital fonts, particularly separately packaged OpenType fonts, can be combined into a single font package. One or more features in the combined OpenType font can be used to access the glyphs from the two digital fonts. Separately packaged fonts from the same font family can be combined, and fonts that are not traditionally considered part of the same font family can be merged. Glyphs sets from different alphabets can be merged into a single digital font. The process of combining separate fonts can be automated to require minimal user interaction.